home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1640 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.0 KB

  1. Date: Sun, 19 Jun 94 19:08:18 -0400
  2. From: dsb@cs.duke.edu (Scott Bigham)
  3. Message-Id: <9406192308.AA01747@amazon.cs.duke.edu>
  4. To: mint@terminator.rs.itd.umich.edu
  5. Subject: The disposition of stderr
  6.  
  7. In my ongoing dialogue with the maintainer of SozobonX, the subject of
  8. stderr has come up.  The xdLibs, with which all the compiler pieces are
  9. built, attaches stderr to file handle -1, which causes tcsh no end of
  10. trouble; for that reason, I'm trying to convince him to fix the xdLibs'
  11. startup code.  For those who haven't been digging in that section of
  12. the code recently ;), here are the relevant lines from the MiNTlibs'
  13. main.c:
  14.  
  15. == main.c ================================================
  16. /* if stderr is not re-directed to a file, force 2 to console
  17.  * (UNLESS we've been run from a shell we trust, i.e. one that supports
  18.  *  the official ARGV scheme, in which case we leave stderr be).
  19.  */
  20.     if(!*_argv[0] && isatty(2))
  21.         (void)Fforce(2, -1);
  22.  
  23. /* deletia... --dsb */
  24.  
  25.     for(i = 0, f = _iob; i < 3; ++i, ++f) {    /* flag device streams */
  26.         if(isatty(f->_file = i))
  27.         /* et cetera... --dsb */
  28. ==========================================================
  29.  
  30. Jerry objects (perhaps rightly so) that checking *_argv[0] is not a fair
  31. test, since (he claims) no Atari release notes on the subject of ARGV
  32. have ever indicated that using the ARGV scheme also entailed the
  33. responsibility of doing the right thing with stderr.  The xdLibs' own
  34. spawn() routines, for instance, support the ARGV scheme (at least
  35. purportedly), but not stderr.
  36.  
  37. Jerry's counter-suggestion is to have the startup code check for the
  38. presence of an environment variable STDERR to decide how to initialize
  39. stderr.  Frankly, the thought makes me shudder.  In the hopes of
  40. averting this catastrophe, I've come to ask if there is any more
  41. reliable way to determine whether one's parent program expects to
  42. receive stderr on handle 2 or -1.  (Yeah, I know, if there were such a
  43. method, the MiNTlibs would be using it, but I'm desperate here).
  44.  
  45. Thanks.
  46.                         -sbigham
  47.